package org.microservice.system.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.microservice.common.bean.PostVo;
import org.microservice.system.dao.SysPostDao;
import org.microservice.system.service.SysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author admin
 * @since 2018-09-04
 */
@Service
public class SysPostServiceImpl extends ServiceImpl<SysPostDao, PostVo> implements SysPostService {


    @Autowired
    private SysPostDao sysPostMapper;
    @Override
    public List<PostVo> getListPage(Map<String,Object> params){

        List<PostVo> sysPostLists= sysPostMapper.getListPage(params);

        return sysPostLists;
    }
    @Override
    public int getListPageTotal(Map<String,Object> params){
        return sysPostMapper.getListPageTotal(params);

    }

    @Override
    public List<PostVo> getByName(String name) {
        List<PostVo> postVos = sysPostMapper.selectList(new EntityWrapper<PostVo>().like("name", name));
        return postVos;
    }

    @Override
    public void updateDisabledById(int id) {
        sysPostMapper.updateDisabledById(id);
    }
}

